package com.xjscrm.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum TradeStatusEnum {

    TRADING(1001, "交易中"),
    TRADE_SUCCESS(1002, "交易成功"),
    TRADE_FAIL(1003, "交易失败"),
    ;

    private final Integer value;
    private final String desc;


    public static TradeStatusEnum getValue(Integer value) {

        for (TradeStatusEnum tradeStatusEnum : TradeStatusEnum.values()) {
            if (Objects.equals(value, tradeStatusEnum.getValue())) {
                return tradeStatusEnum;
            }
        }
        return null;
    }
}
